package com.xingdian.xingdianhulianweb.service.impl;

import com.xingdian.xingdianhulianweb.common.ServerResponse;
import com.xingdian.xingdianhulianweb.mapper.IpInfoMapper;
import com.xingdian.xingdianhulianweb.service.IpInfoService;
import com.xingdian.xingdianhulianweb.vo.IpInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/* *
 * @Author H2SO4
 * @ClassName: IpInfoService
 * @Description TODO
 * @Date 2019/11/26--15:18
 * */
@Service
public class IpInfoServiceImpl implements IpInfoService {

    @Autowired
    IpInfoMapper ipInfoMapper;

    @Override
    public ServerResponse findIpInfo() {
        List<IpInfo> list1 = ipInfoMapper.findIpInfo1();
        List<IpInfo> list2 = ipInfoMapper.findIpInfo2();
        List<IpInfo> list3 = ipInfoMapper.findIpInfo3();
        List<IpInfo> list4 = ipInfoMapper.findIpInfo4();
        Map<String,Object> map =  new HashMap<>();
        map.put("list1",list1);
        map.put("list2",list2);
        map.put("list3",list3);
        map.put("list4",list4);
        return ServerResponse.createBySuccess(map);
    }

    @Override
    public ServerResponse findIpInfos() {
        List<IpInfo> list1 = ipInfoMapper.findIpInfos1();
        List<IpInfo> list2 = ipInfoMapper.findIpInfos2();
        List<IpInfo> list3 = ipInfoMapper.findIpInfos3();
        List<IpInfo> list4 = ipInfoMapper.findIpInfos4();
        Map<String,Object> map =  new HashMap<>();
        map.put("list1",list1);
        map.put("list2",list2);
        map.put("list3",list3);
        map.put("list4",list4);
        return ServerResponse.createBySuccess(map);
    }
}
